﻿
namespace Jet.Dal
{
	/// <summary>
	/// Factory for unit of works
	/// </summary>
	public interface IUnitOfWorkFactory
	{
		/// <summary>
		/// Create a unit of work, which works with 1 type
		/// </summary>
		/// <param name="allowLazyLoading">Determine if lazy loading of navigation properties allowed</param>
		/// <param name="allowProxyCreation">Determine if proxies creation allowed allowed</param>
		IUnitOfWork CreateUoW<TEntity>(bool allowLazyLoading = true, bool allowProxyCreation = true) 
			where TEntity : class;

		/// <summary>
		/// Create a unit of work, which works with 2 types
		/// </summary>
		/// <param name="allowLazyLoading">Determine if lazy loading of navigation properties allowed</param>
		/// <param name="allowProxyCreation">Determine if proxies creation allowed allowed</param>
		IUnitOfWork CreateUoW<TEntity1, TEntity2>(bool allowLazyLoading = true, bool allowProxyCreation = true)
			where TEntity1 : class
			where TEntity2 : class;
		/// <summary>
		/// Create a unit of work, which works with 3 types
		/// </summary>
		/// <param name="allowLazyLoading">Determine if lazy loading of navigation properties allowed</param>
		/// <param name="allowProxyCreation">Determine if proxies creation allowed allowed</param>
		IUnitOfWork CreateUoW<TEntity1, TEntity2, TEntity3>(bool allowLazyLoading = true, bool allowProxyCreation = true)
			where TEntity1 : class
			where TEntity2 : class
			where TEntity3 : class;
		/// <summary>
		/// Create a unit of work, which works with 4 types
		/// </summary>
		/// <param name="allowLazyLoading">Determine if lazy loading of navigation properties allowed</param>
		/// <param name="allowProxyCreation">Determine if proxies creation allowed allowed</param>
		IUnitOfWork CreateUoW<TEntity1, TEntity2,
			TEntity3, TEntity4>(bool allowLazyLoading = true, bool allowProxyCreation = true)
			where TEntity1 : class
			where TEntity2 : class
			where TEntity3 : class
			where TEntity4 : class;
		/// <summary>
		/// Create a unit of work, which works with 5 types
		/// </summary>
		/// <param name="allowLazyLoading">Determine if lazy loading of navigation properties allowed</param>
		/// <param name="allowProxyCreation">Determine if proxies creation allowed allowed</param>
		IUnitOfWork CreateUoW<TEntity1, TEntity2,
			TEntity3, TEntity4, TEntity5>(bool allowLazyLoading = true, bool allowProxyCreation = true)
			where TEntity1 : class
			where TEntity2 : class
			where TEntity3 : class
			where TEntity4 : class
			where TEntity5 : class;
		/// <summary>
		/// Create a unit of work, which works with 6 types
		/// </summary>
		/// <param name="allowLazyLoading">Determine if lazy loading of navigation properties allowed</param>
		/// <param name="allowProxyCreation">Determine if proxies creation allowed allowed</param>
		IUnitOfWork CreateUoW<TEntity1, TEntity2, TEntity3, TEntity4,
			TEntity5, TEntity6>(bool allowLazyLoading = true, bool allowProxyCreation = true)
			where TEntity1 : class
			where TEntity2 : class
			where TEntity3 : class
			where TEntity4 : class
			where TEntity5 : class
			where TEntity6 : class;

		/// <summary>
		/// Create a unit of work, which works with 7 types
		/// </summary>
		/// <param name="allowLazyLoading">Determine if lazy loading of navigation properties allowed</param>
		/// <param name="allowProxyCreation">Determine if proxies creation allowed allowed</param>
		IUnitOfWork CreateUoW<TEntity1, TEntity2, TEntity3, TEntity4, TEntity5,
			TEntity6, TEntity7>(bool allowLazyLoading = true, bool allowProxyCreation = true)
			where TEntity1 : class
			where TEntity2 : class
			where TEntity3 : class
			where TEntity4 : class
			where TEntity5 : class
			where TEntity6 : class
			where TEntity7 : class;

		/// <summary>
		/// Create a unit of work, which works with 8 types
		/// </summary>
		/// <param name="allowLazyLoading">Determine if lazy loading of navigation properties allowed</param>
		/// <param name="allowProxyCreation">Determine if proxies creation allowed allowed</param>
		IUnitOfWork CreateUoW<TEntity1, TEntity2, TEntity3, TEntity4, TEntity5,
			TEntity6, TEntity7, TEntity8>(bool allowLazyLoading = true, bool allowProxyCreation = true)
			where TEntity1 : class
			where TEntity2 : class
			where TEntity3 : class
			where TEntity4 : class
			where TEntity5 : class
			where TEntity6 : class
			where TEntity7 : class
			where TEntity8 : class;

		/// <summary>
		/// Create a unit of work, which works with 9 types
		/// </summary>
		/// <param name="allowLazyLoading">Determine if lazy loading of navigation properties allowed</param>
		/// <param name="allowProxyCreation">Determine if proxies creation allowed allowed</param>
		IUnitOfWork CreateUoW<TEntity1, TEntity2, TEntity3, TEntity4, TEntity5,
			TEntity6, TEntity7, TEntity8, TEntity9>(bool allowLazyLoading = true, bool allowProxyCreation = true)
			where TEntity1 : class
			where TEntity2 : class
			where TEntity3 : class
			where TEntity4 : class
			where TEntity5 : class
			where TEntity6 : class
			where TEntity7 : class
			where TEntity8 : class
			where TEntity9 : class;

		/// <summary>
		/// Create a unit of work, which works with 10 types
		/// </summary>
		/// <param name="allowLazyLoading">Determine if lazy loading of navigation properties allowed</param>
		/// <param name="allowProxyCreation">Determine if proxies creation allowed allowed</param>
		IUnitOfWork CreateUoW<TEntity1, TEntity2, TEntity3, TEntity4, TEntity5,
			TEntity6, TEntity7, TEntity8, TEntity9, TEntity10>(bool allowLazyLoading = true, bool allowProxyCreation = true)
			where TEntity1 : class
			where TEntity2 : class
			where TEntity3 : class
			where TEntity4 : class
			where TEntity5 : class
			where TEntity6 : class
			where TEntity7 : class
			where TEntity8 : class
			where TEntity9 : class
			where TEntity10 : class;

		/// <summary>
		/// Create a unit of work, which works with 11 types
		/// </summary>
		/// <param name="allowLazyLoading">Determine if lazy loading of navigation properties allowed</param>
		/// <param name="allowProxyCreation">Determine if proxies creation allowed allowed</param>
		IUnitOfWork CreateUoW<TEntity1, TEntity2, TEntity3, TEntity4, TEntity5,
			TEntity6, TEntity7, TEntity8, TEntity9, TEntity10, TEntity11>(bool allowLazyLoading = true, bool allowProxyCreation = true)
			where TEntity1 : class
			where TEntity2 : class
			where TEntity3 : class
			where TEntity4 : class
			where TEntity5 : class
			where TEntity6 : class
			where TEntity7 : class
			where TEntity8 : class
			where TEntity9 : class
			where TEntity10 : class
			where TEntity11 : class;

		/// <summary>
		/// Create a unit of work, which works with 11 types
		/// </summary>
		/// <param name="allowLazyLoading">Determine if lazy loading of navigation properties allowed</param>
		/// <param name="allowProxyCreation">Determine if proxies creation allowed allowed</param>
		IUnitOfWork CreateUoW
			<TEntity1, TEntity2, TEntity3, TEntity4, TEntity5, TEntity6,
			TEntity7, TEntity8, TEntity9, TEntity10, TEntity11, TEntity12>(bool allowLazyLoading = true, bool allowProxyCreation = true)
			where TEntity1 : class
			where TEntity2 : class
			where TEntity3 : class
			where TEntity4 : class
			where TEntity5 : class
			where TEntity6 : class
			where TEntity7 : class
			where TEntity8 : class
			where TEntity9 : class
			where TEntity10 : class
			where TEntity11 : class
			where TEntity12 : class;
	}
}
